% LaTeX-Kasettenmakros V. 1.2, 01.05.1994
% Copyright (C) 1994 Andreas Schrell und Michael Rogalla, alle Rechte vorbehalten.
% Fehlermeldungen bei unver�nderter Version bitte an:
%
%                          Michael Rogalla
%                          Am Tannenbaum 6
%                          42499 H�ckeswagen
%
%
% Standardeinstellung
%
\def\SP{\unitlength=1mm
\linethickness{0.3mm}
\begin{picture}(9.80,11.00)
\put(8.00,0.00){\line(0,1){11.00}}
\linethickness{0.1mm}
\put(-3.10,-66.00){\line(1,0){1.00}}
\put(97.90,-66.00){\line(-1,0){1.00}}
\end{picture}}
\def\QA{}
\def\QB{}
\def\ZA{}
\def\ZB{}
\def\RA{}
\def\RB{}
\def\RandTitel{\hfill}
\def\casnr{}

% Makros f�r gedrehte Schriften:
\newcommand{\nline}{\\}
{\catcode`p=12\catcode`t=12\gdef\nline#1pt{#1}}

\let\getfactor=\nline

\def\dolist{\afterassignment\dodolist\let\next= }

\def\dodolist{\ifx\next\endelist\let\next\relax
    \else \nline\let\next\dolist \fi\next}

\def\endelist{\endlist}

\def\nline{% next char letter or space
  \expandafter\if\space\next\addspace\else\point\next\fi}

\newdimen\x
\newdimen\y
\def\initialize{\global\x=0pt\global\y=0pt}

\newdimen\DeltaX
\newdimen\DeltaY
\def\newcoords{%
  \DeltaX=\expandafter\getfactor\the\fontdimen11\anglefont \wd0
  \DeltaY=\expandafter\getfactor\the\fontdimen10\anglefont \wd0
  \global\advance\x by \DeltaX
  \global\advance\y by \DeltaY}

\newbox\spacebox
\setbox\spacebox=\hbox{\ }

\def\addspace{\setbox0=
  \copy\spacebox \newcoords}

\def\point#1{%
   \setbox0=\hbox{\anglefont #1}% used by \newcoords
   \setbox2=\hbox{\anglefont #1}% used for typesetting
   \wd2=0pt \ht2=0pt \dp2=0pt
   \rlap{\kern\x \raise\y \box2}%
   \newcoords}

% the name off the game
\parindent=0pt
\parskip=0pt
%\pagestyle{empty}

\def\cassette#1
% begin
{\def\test{#1}\ifx\test\empty\else\Rand{#1}\fi
 \hbox\bgroup\vbox\bgroup\fboxsep=2mm
 \hbox{\fbox{\vbox to 12mm{\hsize=97mm
 \ifx\selectfont\undefined\footnotesize\else%
 \fontfamily{cmr}\fontseries{m}\fontshape{n}\fontsize{10}{10pt}\selectfont\fi
 {{\bf A}\underline{\hfill\hbox to 30mm{\hfill\ZA\hfill}\hfill
 \hfill\hbox to 29.5mm{\hfill Tag\,/\,Zeit\hfill}
 \hfill\hbox to 30mm{\hfill\ZB\hfill}\hfill}{\bf B}} \vfil
 {\underline{\hfill \hbox to 30mm{\hfill\RA\hfill}\hfill
 \hfill\hbox to 35mm{\hfill Rauschunterdr�ckung\hfill}
 \hfill\hbox to 30mm{\hfill\RB\hfill}\hfill}} \vfil
 {\hfill\hbox to 30mm{\hfill\QA\hfill}\hfill
 \hfill\hbox to 35mm{\hfill Quelle\hfill}
 \hfill\hbox to 30mm{\hfill\QB\hfill}\hfill}
 \vfil}}}\nointerlineskip\kern-\fboxrule
 \fboxsep=1mm
 \hbox{\fbox{\hbox{\kern1mm\SP\vbox to 11mm{\hsize=86.05mm\vfil %
% ------------------------------------------------------------------------
% falls der Rahmen des Titelbereiches nicht korrekt gesetzt worden ist,
% dann bitte \hsize=86.05mm in 0.05mm-Schritten �ndern
% ------------------------------------------------------------------------
 \ifx\selectfont\undefined\Large\else%
 \fontseries{m}\fontshape{n}\fontsize{12}{14pt}\selectfont\fi
 \RandTitel{\hfill\ifx\selectfont\undefined\tiny\else%
 \fontsize{8}{8pt}\selectfont\fi\casnr}\par
 \vfil}\kern1mm}}}\nointerlineskip\kern-\fboxrule
 \fboxsep=2mm
 \setbox0\vbox to 123mm\bgroup\hsize=97mm
 \ifx\selectfont\undefined\normalsize\else%
 \fontseries{m}\fontshape{n}\fontsize{10}{12pt}\selectfont\fi
}%
% end
\def\endcassette{\par\vfil\egroup
 \hbox{\fbox{\box0}}\egroup\egroup\par}

% Titelbereich:
\newcommand{\Rand}[1]{\def\RandTitel{#1}}

% Maximale Spielzeit der Kasette:
\newcommand{\CA}[0]{\unitlength=1mm
\begin{picture}(0,0)
\put(0.30,6.50){\line(1,0){4.60}}
\put(0.00,6.80){\line(0,1){2.00}}
\put(2.60,6.80){\line(0,1){2.00}}
\put(5.20,6.80){\line(0,1){2.00}}
\put(0.30,1.90){\line(1,0){4.60}}
\put(0.00,2.20){\line(0,1){2.00}}
\put(0.30,4.50){\line(1,0){4.60}}
\put(5.20,2.20){\line(0,1){2.00}}
\end{picture}}
\newcommand{\CB}[0]{\unitlength=1mm
\begin{picture}(0,0)
\put(0.30,6.50){\line(1,0){4.60}}
\put(2.60,6.80){\line(0,1){2.00}}
\put(2.90,9.10){\line(1,0){2.00}}
\put(0.00,2.20){\line(0,1){2.00}}
\put(0.30,1.90){\line(1,0){2.00}}
\put(2.60,2.20){\line(0,1){2.00}}
\put(2.90,4.50){\line(1,0){2.00}}
\put(5.20,2.20){\line(0,1){2.00}}
\end{picture}}
\newcommand{\CC}[0]{\unitlength=1mm
\begin{picture}(0,0)
\put(0.30,9.10){\line(1,0){4.60}}
\put(0.00,6.80){\line(0,1){2.00}}
\put(2.60,6.80){\line(0,1){2.00}}
\put(5.20,6.80){\line(0,1){2.00}}
\put(0.30,6.50){\line(1,0){2.00}}
\put(0.30,1.90){\line(1,0){4.60}}
\put(0.00,2.20){\line(0,1){2.00}}
\put(0.30,4.50){\line(1,0){4.60}}
\put(5.20,2.20){\line(0,1){2.00}}
\end{picture}}
\newcommand{\CD}[0]{\unitlength=1mm
\begin{picture}(0,0)
\put(0.30,6.50){\line(1,0){4.60}}
\put(0.00,6.80){\line(0,1){2.00}}
\put(2.60,6.80){\line(0,1){2.00}}
\put(5.20,6.80){\line(0,1){2.00}}
\put(2.90,9.10){\line(1,0){2.00}}
\put(0.30,1.90){\line(1,0){4.60}}
\put(0.00,2.20){\line(0,1){2.00}}
\put(0.30,4.50){\line(1,0){4.60}}
\put(5.20,2.20){\line(0,1){2.00}}
\end{picture}}
\newcommand{\CE}[0]{\unitlength=1mm
\begin{picture}(0,0)
\put(5.20,8.90){\line(0,1){1.00}}
\put(0.30,8.60){\line(1,0){4.60}}
\put(0.30,5.00){\line(1,0){4.60}}
\put(0.00,5.30){\line(0,1){2.00}}
\put(5.20,5.30){\line(0,1){2.00}}
\put(0.30,7.60){\line(1,0){4.60}}
\put(0.30,1.40){\line(1,0){4.60}}
\put(0.00,1.70){\line(0,1){2.00}}
\put(0.30,4.00){\line(1,0){4.60}}
\put(5.20,1.70){\line(0,1){2.00}}
\end{picture}}
\newcommand{\CF}[0]{\unitlength=1mm
\begin{picture}(0,0)
\put(5.20,8.10){\line(0,1){1.00}}
\put(0.30,7.80){\line(1,0){4.60}}
\put(5.20,5.80){\line(0,1){1.00}}
\put(0.30,5.50){\line(1,0){4.60}}
\put(0.30,1.90){\line(1,0){4.60}}
\put(0.00,2.20){\line(0,1){2.00}}
\put(0.30,4.50){\line(1,0){4.60}}
\put(5.20,2.20){\line(0,1){2.00}}
\end{picture}}
\newcommand{\CG}[0]{\unitlength=1mm
\begin{picture}(0,0)
\put(5.20,8.90){\line(0,1){1.00}}
\put(0.30,8.60){\line(1,0){4.60}}
\put(2.90,5.00){\line(1,0){2.00}}
\put(0.00,5.30){\line(0,1){2.00}}
\put(2.60,5.30){\line(0,1){2.00}}
\put(5.20,5.30){\line(0,1){2.00}}
\put(0.30,7.60){\line(1,0){2.00}}
\put(0.30,1.40){\line(1,0){4.60}}
\put(0.00,1.70){\line(0,1){2.00}}
\put(0.30,4.00){\line(1,0){4.60}}
\put(5.20,1.70){\line(0,1){2.00}}
\end{picture}}

\newcommand{\SpielZeit}[1]{\def\sz{#1}
\def\SP{\unitlength=1mm
\linethickness{0.3mm}
\begin{picture}(9.80,11.00)
\if \sz a \put(0,0){\CA}\fi
\if \sz b \put(0,0){\CB}\fi
\if \sz c \put(0,0){\CC}\fi
\if \sz d \put(0,0){\CD}\fi
\if \sz e \put(0,0){\CE}\fi
\if \sz f \put(0,0){\CF}\fi
\if \sz g \put(0,0){\CG}\fi
\put(8.00,0.00){\line(0,1){11.00}}
\linethickness{0.1mm}
\put(-3.10,-66.00){\line(1,0){1.00}}
\put(97.90,-66.00){\line(-1,0){1.00}}
\end{picture}}}

% Maximale Spielzeit der Kasette (gedrehte Schriften):
\newcommand{\SpielZeitR}[2]{\def\sz{#1}\font\anglefont=#2
\def\SP{\unitlength=1mm
\linethickness{0.3mm}
\begin{picture}(9.80,11.00)
\ifx\sz\empty\else\put(0.90,6.50){\makebox(0,0)[cc]{%
 \dolist\initialize #1 \endelist}}\fi
\put(8.00,0.00){\line(0,1){11.00}}
\linethickness{0.1mm}
\put(-3.10,-66.00){\line(1,0){1.00}}
\put(97.90,-66.00){\line(-1,0){1.00}}
\end{picture}}}

% Interpret, Autor, S�nger oder Gruppe:
\def\Saenger{\@ifnextchar [{\@Saenger}{\@Saenger[]}}
\def\@Saenger[#1]#2{{\ifx\selectfont\undefined\bf\else%
 \fontseries{b}\selectfont\fi\underline{#2:}\ifx#1\empty\else%
 ~\hfill\penalty10000[#1]\fi\par\vspace*{1.5mm}}}

% Name des Musikst�ckes:
\def\Titel{\@ifnextchar [{\@Titel}{\@Titel[]}}
\def\@Titel[#1]#2{#2\ifx#1\empty\else%
 ~\hfill\penalty10000[#1]\fi\par}
%\newcommand{\Titel}[2]{#1\ifx#2\empty\else~\hfill\penalty10000[#2]\fi\par}

% Quelle der Seite A:
\newcommand{\QuellA}[1]{\def\QA{#1}}

% Quelle der Seite B:
\newcommand{\QuellB}[1]{\def\QB{#1}}

% Datum/Zeit der Aufnahme der Seite A:
\newcommand{\ZeitA}[1]{\def\ZA{#1}}

% Datum/Zeit der Aufnahme der Seite B:
\newcommand{\ZeitB}[1]{\def\ZB{#1}}

% Art der Rauschunterdr�ckung der Seite A:
\newcommand{\RauschA}[1]{\def\RA{#1}}

% Art der Rauschunterdr�ckung der Seite B:
\newcommand{\RauschB}[1]{\def\RB{#1}}

% Bereich der Inhaltsangabe teilen (vertikal):
\newdimen\merkorgH\merkorgH=\hsize
\newdimen\merkH
\newcommand{\geteilt}[2]{\merkH=0.5\hsize
 \advance \merkH by -2mm
 \merkorgH=\merkH
 \hbox to \hsize{\raggedright\sloppy
 \vtop{\hsize=\merkH\relax #1}\hfil\vrule\hfil
 \vtop{\hsize=\merkH\relax #2}}}

% Bereich der Inhaltsangabe teilen (horizontal):
\newcommand{\ZweiteSeite}{\ifdim \merkorgH=\merkH\else
\vspace{2mm} \hrule width\hsize \vspace{2mm}\fi}

% Nummer der Kasette (gedrehte Schrift):
\newcommand{\CassNrR}[2]{\def\casnr{\font\anglefont=#2\raisebox{9.25mm}[][]{%
 \dolist\initialize Nr.: #1\endelist}\hspace*{1.3mm}}}

% Nummer der Kasette:
\newcommand{\CassNr}[1]{\def\casnr{Nr.: #1}}

\endinput